<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    	<title>统战成员学习平台</title>
	    <link rel="stylesheet" type="text/css" href="../../css/base.css" />
	    <link rel="stylesheet" type="text/css" href="../../css/style.css" />
	</head>
	<body>
		<div id='app' style="display:none" v-show="true">
			<ul class="study_his_list">
				<li v-for="item of items">
					<p class="title"><i class="icon_chapter"></i>{{item.scheduleName}}</p>
					<p v-if="item.rate === 100" class="score">综合成绩：<span>60</span> 分</p>
					<p class="date">{{item.startTime.split(' ')[0].replace(/\-/g, '.') + '-' + item.endTime.split(' ')[0].replace(/\-/g, '.')}}</p>
					<ul class="bottom">
						<li tapmode @click="openWin('lesson_win', {courseId: item.courseId })"><img src="../../image/detail_g.png"><p>课程详情</p></li>
						<li tapmode @click="openScore(item)"><img :src="'../../image/certificate_' + (item.hasReport ? 'g' : 'disable') + '.png'"><p>成绩单</p></li>
						<li tapmode @click="cert(item)"><img :src="'../../image/report_' + (item.hasDiploma ? 'g' : 'disable') + '.png'"><p>结业证书</p></li>
					</ul>
				</li>
				<li v-if="!items.length" class="no_more">没有已结束的学习计划</li>
			</ul>
		</div>
		<script type="text/javascript" src="../../script/api.js"></script>
		<script type="text/javascript" src="../../script/vue.min.js"></script>
		<script type="text/javascript" src="../../script/common.js"></script>
		<script type="text/javascript" src="../../script/layer_mobile/layer.js"></script>
		<script type="text/javascript">
		    new Vue({
				el: '#app',
		     	data: {
					items: []
		     	},
				mounted: function() {
		        	var $this = this;
		        	apiready = function() {
						api.parseTapmode();
						$this.init();
                	}
		    	},
		    	methods: {
					init: function() {
						var $this = this;
						post('/client/learnCenter/selectOutTimeSchedule', {}, function(ret) {
							$this.items = ret.data
						})
					},
					cert: function(item) {
						if(item.hasDiploma) {
							openWin('./certificate_win', {scheduleId: item.scheduleId})
						}
					},
					openScore: function (item) {
						if(!item.hasReport) return;
						openWin('./score_win', {courseName: item.courseName,courseId: item.courseId, scheduleId: item.scheduleId})
					}
		    	}
		    });
		</script>
	</body>
</html>
